/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FrmPrincipal.java
 *
 * Created on 29/09/2011, 10:33:56
 */
package viewer;

import dados.storyteller.vampiro.FrmRoladorMascara;
import calculadora.storyteller.vampiro.FrmCalculadoraMascara;
import ficha.storyteller.vampiro.FrameFichaMascara;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URISyntaxException;
import javax.swing.JEditorPane;
import javax.swing.JOptionPane;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;

/**
 *
 * @author yurifw
 */
public class FrmPrincipal extends javax.swing.JFrame {

    /**
     * Creates new form FrmPrincipal
     */
    public FrmPrincipal() {
        initComponents();



    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        desktop = new javax.swing.JDesktopPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        mnuMascara = new javax.swing.JMenu();
        mnuCalculadoraMascara = new javax.swing.JMenuItem();
        mnuFichaMascara = new javax.swing.JMenuItem();
        mnuRoladorMascara = new javax.swing.JMenuItem();
        mnuRequiem = new javax.swing.JMenu();
        mnuCalculadoraRequiem = new javax.swing.JMenuItem();
        mnuRoladorRequiem = new javax.swing.JMenuItem();
        mnuSobre = new javax.swing.JMenu();
        mnuLicenca = new javax.swing.JMenuItem();
        mnuContato = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("World Of Darkness Tools");
        setExtendedState(MAXIMIZED_BOTH);
        getContentPane().setLayout(new java.awt.GridLayout(1, 0));
        getContentPane().add(desktop);

        mnuMascara.setText("Vampiro: A Máscara");

        mnuCalculadoraMascara.setText("Calculadora de Experiencia");
        mnuCalculadoraMascara.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuCalculadoraMascaraActionPerformed(evt);
            }
        });
        mnuMascara.add(mnuCalculadoraMascara);

        mnuFichaMascara.setText("Ficha");
        mnuFichaMascara.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuFichaMascaraActionPerformed(evt);
            }
        });
        mnuMascara.add(mnuFichaMascara);

        mnuRoladorMascara.setText("Rolador de Dados");
        mnuRoladorMascara.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuRoladorMascaraActionPerformed(evt);
            }
        });
        mnuMascara.add(mnuRoladorMascara);

        jMenuBar1.add(mnuMascara);

        mnuRequiem.setText("Vampiro: Requiem");

        mnuCalculadoraRequiem.setText("Calculadora de Experiencia");
        mnuCalculadoraRequiem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuCalculadoraRequiemActionPerformed(evt);
            }
        });
        mnuRequiem.add(mnuCalculadoraRequiem);

        mnuRoladorRequiem.setText("Rolador de Dados");
        mnuRoladorRequiem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuRoladorRequiemActionPerformed(evt);
            }
        });
        mnuRequiem.add(mnuRoladorRequiem);

        jMenuBar1.add(mnuRequiem);

        mnuSobre.setText("Sobre");

        mnuLicenca.setText("Licença");
        mnuLicenca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuLicencaActionPerformed(evt);
            }
        });
        mnuSobre.add(mnuLicenca);

        mnuContato.setText("Contato");
        mnuContato.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuContatoActionPerformed(evt);
            }
        });
        mnuSobre.add(mnuContato);

        jMenuBar1.add(mnuSobre);

        setJMenuBar(jMenuBar1);

        setSize(new java.awt.Dimension(548, 401));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void mnuCalculadoraMascaraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuCalculadoraMascaraActionPerformed
        // TODO add your handling code here:
        FrmCalculadoraMascara calculadoraMascara = new FrmCalculadoraMascara();
        desktop.add(calculadoraMascara);
        calculadoraMascara.setVisible(true);
        mnuCalculadoraMascara.setEnabled(false);
    }//GEN-LAST:event_mnuCalculadoraMascaraActionPerformed

    private void mnuRoladorMascaraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuRoladorMascaraActionPerformed
        // TODO add your handling code here:
        FrmRoladorMascara roladorMascara = new FrmRoladorMascara();
        desktop.add(roladorMascara);
        roladorMascara.setVisible(true);
        mnuRoladorMascara.setEnabled(false);
    }//GEN-LAST:event_mnuRoladorMascaraActionPerformed

    private void mnuCalculadoraRequiemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuCalculadoraRequiemActionPerformed
        // TODO add your handling code here:
        FrmCalculadoraRequiem calculadoraRequiem = new FrmCalculadoraRequiem();
        desktop.add(calculadoraRequiem);
        calculadoraRequiem.setVisible(true);
        mnuCalculadoraRequiem.setEnabled(false);
    }//GEN-LAST:event_mnuCalculadoraRequiemActionPerformed

    private void mnuRoladorRequiemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuRoladorRequiemActionPerformed
        // TODO add your handling code here:
        FrmRoladorRequiem roladorRequiem = new FrmRoladorRequiem();
        desktop.add(roladorRequiem);
        roladorRequiem.setVisible(true);
        mnuRoladorRequiem.setEnabled(false);
    }//GEN-LAST:event_mnuRoladorRequiemActionPerformed

    private void mnuFichaMascaraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuFichaMascaraActionPerformed
        // TODO add your handling code here:
//        FrmFichaMascara fichaMascara = new FrmFichaMascara();
//        fichaMascara.setVisible(true);
        FrameFichaMascara ficha = new FrameFichaMascara();
        ficha.setVisible(true);

    }//GEN-LAST:event_mnuFichaMascaraActionPerformed

    private void mnuContatoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuContatoActionPerformed
        JEditorPane message = new JEditorPane("text/html", "<html>Sistema desenvolvido por Yuri de Freitas Waki<br>"
                + "E-mail: yuridefw2@gmail.com<br>"
                + "Link para a Página do projeto: <a href=\"http://code.google.com/p/jrpg-toolkit/\">http://code.google.com/p/jrpg-toolkit/</a></html>");
        
        message.setEditable(false);
        message.setBackground(this.getBackground());
        message.addHyperlinkListener(new HyperlinkListener() {
            @Override
            public void hyperlinkUpdate(HyperlinkEvent e) {
                if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
                    try {
                        Desktop.getDesktop().browse(e.getURL().toURI());
                    } catch (URISyntaxException | IOException ex) {
                        ex.printStackTrace();
                    }
                }
            }
        });
        JOptionPane.showMessageDialog(rootPane, message);
    }//GEN-LAST:event_mnuContatoActionPerformed

    private void mnuLicencaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuLicencaActionPerformed
        JOptionPane.showMessageDialog(rootPane, "Projeto livre, licenciado sob Apache License 2.0");
    }//GEN-LAST:event_mnuLicencaActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FrmPrincipal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane desktop;
    private javax.swing.JMenuBar jMenuBar1;
    public static javax.swing.JMenuItem mnuCalculadoraMascara;
    public static javax.swing.JMenuItem mnuCalculadoraRequiem;
    private javax.swing.JMenuItem mnuContato;
    private javax.swing.JMenuItem mnuFichaMascara;
    private javax.swing.JMenuItem mnuLicenca;
    private javax.swing.JMenu mnuMascara;
    private javax.swing.JMenu mnuRequiem;
    public static javax.swing.JMenuItem mnuRoladorMascara;
    public static javax.swing.JMenuItem mnuRoladorRequiem;
    private javax.swing.JMenu mnuSobre;
    // End of variables declaration//GEN-END:variables
}
